from django.urls import path
from apps.goods.views import IndexView, SKUSearchView,HotGoodsView,ListView,DetailView,CategoryVisitCountView
from haystack.views import search_view_factory  # 导入 search_view_factory

urlpatterns = [
    path('index/', IndexView.as_view()),
    path('list/<category_id>/skus/',ListView.as_view()),
    path('search/', search_view_factory(view_class=SKUSearchView)),  # 使用 search_view_factory
    path('hot/<category_id>/', IndexView.as_view()),
    path('detail/<sku_id>/', DetailView.as_view()),
    path('detail/visit/<category_id>/', CategoryVisitCountView.as_view()),
]